package hotel;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.events.SelectionListener;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.events.SelectionAdapter;

public class MainHotel {

	/**
	 * Launch the application.
	 * @param args
	 */
	public static void main(String[] args) {
		final Display display = Display.getDefault();
		final Shell shlHotelSoft = new Shell(display, SWT.MIN);
		shlHotelSoft.setSize(344, 219);
		shlHotelSoft.setText("Hotel soft");
		shlHotelSoft.setLayout(new GridLayout(6, true));
		
		Button b_createHotel = new Button(shlHotelSoft, SWT.NONE );
		b_createHotel.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent arg0) {
				
				createHotel gHotel = new createHotel();
				gHotel.open();
			}
		});
		GridData gd_b_createHotel = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
		gd_b_createHotel.heightHint = 36;
		gd_b_createHotel.widthHint = 155;
		b_createHotel.setLayoutData(gd_b_createHotel);
		b_createHotel.setText("\u0421\u044A\u0437\u0434\u0430\u0439 \u0445\u043E\u0442\u0435\u043B");
		
		Button b_rezerve = new Button(shlHotelSoft, SWT.NONE);
		b_rezerve.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent arg0) {
				
				addReserve gReserve = new addReserve();
				gReserve.open();
			}
		});
		GridData gd_b_rezerve = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
		gd_b_rezerve.heightHint = 36;
		gd_b_rezerve.widthHint = 155;
		b_rezerve.setLayoutData(gd_b_rezerve);
		b_rezerve.setText("\u0420\u0435\u0437\u0435\u0432\u0430\u0446\u0438\u0438");
		
		Button b_reshetka = new Button(shlHotelSoft, SWT.NONE);
		b_reshetka.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent arg0) {
			}
		});
		GridData gd_b_reshetka = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
		gd_b_reshetka.heightHint = 36;
		gd_b_reshetka.widthHint = 155;
		b_reshetka.setLayoutData(gd_b_reshetka);
		b_reshetka.setText("\u0420\u0435\u0448\u0435\u0442\u043A\u0430");
		
		Button b_pay = new Button(shlHotelSoft, SWT.NONE);
		b_pay.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent arg0) {
			}
		});
		GridData gd_b_pay = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
		gd_b_pay.heightHint = 36;
		gd_b_pay.widthHint = 155;
		b_pay.setLayoutData(gd_b_pay);
		b_pay.setText("\u041F\u043B\u0430\u0449\u0430\u043D\u0435");
		
		Button b_settings = new Button(shlHotelSoft, SWT.NONE);
		b_settings.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent arg0) {
			}
		});
		GridData gd_b_settings = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
		gd_b_settings.heightHint = 36;
		gd_b_settings.widthHint = 155;
		b_settings.setLayoutData(gd_b_settings);
		b_settings.setText("\u041D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438");
		
		Button b_spravka = new Button(shlHotelSoft, SWT.NONE);
		b_spravka.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent arg0) {
			}
		});
		GridData gd_b_spravka = new GridData(SWT.LEFT, SWT.CENTER, false, false, 3, 1);
		gd_b_spravka.heightHint = 36;
		gd_b_spravka.widthHint = 155;
		b_spravka.setLayoutData(gd_b_spravka);
		b_spravka.setText("\u0421\u043F\u0440\u0430\u0432\u043A\u0438");
		new Label(shlHotelSoft, SWT.NONE);
		new Label(shlHotelSoft, SWT.NONE);
		new Label(shlHotelSoft, SWT.NONE);
		new Label(shlHotelSoft, SWT.NONE);
		new Label(shlHotelSoft, SWT.NONE);
		new Label(shlHotelSoft, SWT.NONE);
		new Label(shlHotelSoft, SWT.NONE);
		new Label(shlHotelSoft, SWT.NONE);
		
		Button b_exit = new Button(shlHotelSoft, SWT.NONE);
		b_exit.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent arg0) {
				display.dispose();
			}
		});
		GridData gd_b_exit = new GridData(SWT.LEFT, SWT.CENTER, false, false, 2, 1);
		gd_b_exit.widthHint = 100;
		b_exit.setLayoutData(gd_b_exit);
		b_exit.setText("\u0418\u0437\u0445\u043E\u0434");
		new Label(shlHotelSoft, SWT.NONE);
		new Label(shlHotelSoft, SWT.NONE);

		shlHotelSoft.open();
		shlHotelSoft.layout();
		while (!shlHotelSoft.isDisposed()) {
			if (!display.readAndDispatch()) {
				display.sleep();
			}
		}
	}

}
